[Performance] Reuse preview directory listing#35129
[Performance] Reuse preview directory listing#35129szaimen merged 8 commits intonextcloud:masterfrom
Conversation
artonge
left a comment
There was a problem hiding this comment.
Am I right that this PR "only" moves the getDirectoryListing call from getSmallImagePreview to generatePreviews?
All other code changes are to:
- pass
previewFilesto all the methods - reuse some logic to make
getSmallImagePreviewsmaller withgetCachedPreviewandgenerateProviderPreview
Yes, the rationale is that calling I've noticed that |
|
@Glandos can you rebase ? our bot cannot rebase on forks this should help bring the branch up to date and help wake up the CI jobs that got stuck |
|
@PVince81 commented on Jan 11, 2023, 9:01 PM GMT+1:
This is now rebased on current master. |
|
Failures seemed unrelated but restarted cypress to be sure ;) |
|
hmmm, is background rendering using the previews endpoint ? |
getCachedPreview used to call `getFile`, and this calls `getDirectoryListing` (or underlying function that list directory) to find the file. This was done for every preview spec. Now, this is done only once at the beginning of the loop, and the array is just iterated when needed to find the correct entry. Signed-off-by: Glandos <bugs-github@antipoul.fr>
Signed-off-by: Glandos <bugs-github@antipoul.fr>
Signed-off-by: Glandos <bugs-github@antipoul.fr>
Signed-off-by: Glandos <bugs-github@antipoul.fr>
getDirectoryListing should return all files getFile is not called anymore Signed-off-by: Glandos <bugs-github@antipoul.fr>
use directory listing in both functions to gain 25% speed on run where every preview already exist. Signed-off-by: Glandos <bugs-github@antipoul.fr>
Signed-off-by: Glandos <bugs-github@antipoul.fr>
Superseed #34910
Use directory listing in both functions to gain 25% speed on run where every preview already exist.
I went from "./occ preview:generate-all" from 159 seconds down to 17 seconds on a directory full of images with already generated previews.